package com.example.video.common.config;


import com.example.video.common.http.IErrorCode;

/**
 * 自定义全局异常
 *
 */
public class BusinessException extends RuntimeException{
    private IErrorCode errorCode;

    public BusinessException(String message) {
        super(message);
    }

    public BusinessException(IErrorCode errorCode) {
        super(errorCode.getErrorMessage());
        this.errorCode = errorCode;
    }

    public BusinessException(Throwable cause) {
        super(cause);
    }

    public BusinessException(String message, Throwable cause) {
        super(message, cause);
    }

    public IErrorCode getErrorCode() {
        return errorCode;
    }


}
